package router

import (
	jwt "gitee.com/sansaniot/ssiot-core/httpmvc/jwtauth"
	"github.com/gin-gonic/gin"
	apis2 "ssadmin/internal/admin/apis"
)

func init() {
	AuthRouters = append(AuthRouters, registerUserRouter)
}

// registerUserRouter
func registerUserRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := apis2.User{}

	r := v1.Group("/api/user").Use(authMiddleware.MiddlewareFuncWithOutValidate())
	{
		r.GET("/find", api.FindList)
		r.GET("/get", api.GetProfile)
		r.POST("/add", api.Insert)
		r.POST("/modify", api.Update)
		r.POST("/remove", api.Delete)
		r.POST("/password/modify", api.UpdatePassword)
		r.POST("/password/reset", api.ResetPassword)
		r.GET("/find/recur", api.FindCurList)
		r.POST("/qr-code/cache", api.QrCodeCache)
	}
}
